# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=pyersinia
pkgver=49.73f4056
pkgrel=13
groups=('blackarch' 'blackarch-networking' 'blackarch-fuzzer'
        'blackarch-dos' 'blackarch-voip' 'blackarch-scanner'
        'blackarch-exploitation')
pkgdesc='Network attack tool like yersinia but written in Python.'
arch=('any')
url='https://github.com/nottinghamprisateam/pyersinia'
license=('MIT')
depends=('python' 'python-scapy' 'python-sphinx' 'python-termcolor'
         'python-netaddr' 'python-ipy' 'python-pcapy' 'python-netifaces'
         'python-sphinx_rtd_theme' 'python-pydnet' 'python-setuptools')
makedepends=('git')
source=("git+https://github.com/nottinghamprisateam/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

build() {
  cd $pkgname

  python setup.py build
}

package() {
  cd $pkgname

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md CHANGELOG
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

